package com.ruoyi.common.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 读取项目相关配置
 *
 * @author ruoyi
 */
@Component
@ConfigurationProperties(prefix = "jo")
public class JoConfig
{
    /**
     * 过滤器放行地址
     */
    private String url;

    /**
     * 是否可重复登录
     */
    private Boolean repeat;
    /**
     * 是否使用设备唯一识别码
     */
    private Boolean udid;
    /**
     * 是否启用任务
     */
    private Boolean job;

    /**
     * flyflow 跨库查询数据库名称
     */
    @Getter
    @Setter
    private String flyflow;

    public Boolean getJob()
    {
        return job;
    }

    public void setJob(Boolean job)
    {
        this.job = job;
    }

    public Boolean getUdid()
    {
        return udid;
    }

    public void setUdid(Boolean udid)
    {
        this.udid = udid;
    }

    public void setUdid(String udid)
    {
        this.udid = "true".equals(udid);
    }

    public String getUrl()
    {
        return url;
    }

    public void setUrl(String url)
    {
        this.url = url;
    }

    public Boolean getRepeat()
    {
        return repeat;
    }

    public void setRepeat(Boolean repeat)
    {
        this.repeat = repeat;
    }

    public void setRepeat(String repeat)
    {
        this.repeat = "true".equals(repeat);
    }
}
